package com.seashop.feign;

import com.alibaba.fastjson.JSONObject;
import com.seashop.feign.fallback.ProductFeignClientFallBack;
import com.seashop.response.ResponseBase;
import com.seashop.vo.ProductSimpleVO;
import com.seashop.request.RecommendProductRequestParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author moredln
 * @desc 产品模块feign调用
 * @date 2020-08-07 23:22
 */
@FeignClient(value = "product", fallback = ProductFeignClientFallBack.class)
public interface ProductFeignClient {

    @GetMapping("/category/listCategory")
    ResponseBase listCategory(@RequestParam("countryCode") String countryCode, @RequestParam("languageType") String languageType);

    @GetMapping("/listRecommendProductPage")
    ResponseBase listRecommendProductPage(RecommendProductRequestParam param);

    @GetMapping("/getExternProductDetail")
    JSONObject getExternProductDetail(@RequestParam("productId") String productId, @RequestParam("origin") String origin, @RequestParam("countryCode") String countryCode, @RequestParam("languageType") String languageType, @RequestParam("userId") Long userId);

    @GetMapping("/queryProductSimpleInfoAndShare")
    List<ProductSimpleVO> queryProductSimpleInfoAndShare(@RequestParam("ids") Integer[] ids, @RequestParam("countryCode") String countryCode);

    @GetMapping("/queryProductSimpleInfo")
    List<ProductSimpleVO> queryProductSimpleInfo(@RequestParam("ids") Integer[] ids, @RequestParam("countryCode") String countryCode, @RequestParam("languageType") String languageType);

    @GetMapping("/dictionary/queryDictionary")
    String queryDictionary(@RequestParam("text") String text, @RequestParam("fromLanguageType") String fromLanguageType, @RequestParam("toLanguageType") String toLanguageType);
}
